<!-- Data Tables -->
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{:lang('Confirmation of receivables')}</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" enctype="multipart/form-data" action="{:url('otc/receive')}" method="post">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Order status')}：</label>
                            <div class="col-sm-8">
                                <input  type="text" class="form-control" value="{$state}" readonly="readonly">
                               
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Purchase quantity')}：</label>
                            <div class="col-sm-8">
                                <input  type="text" class="form-control" value="{$sell.buy_num}" readonly="readonly">
                                <input  type="hidden" class="form-control" name="id" value="{$sell.id}" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Buyer')}：</label>
                            <div class="col-sm-8">
                                <input id="btc" type="text" readonly="readonly" class="form-control" value="{$user.nickname}" value="" aria-required="true">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Phone')}：</label>
                            <div class="col-sm-8">
                                <input id="email" type="text" readonly="readonly" class="form-control" name="opening" value="{$user.mobile}" required="" aria-required="true">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">Email：</label>
                            <div class="col-sm-8">
                                <input id="cemail" type="text" readonly="readonly" class="form-control" name="opening" value="{$user.e_mail}" required="" aria-required="true">
                            </div>
                        </div>

                        

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Payment voucher')}：</label>
                            <div class="col-sm-8">
                                 {if condition="$sell['status'] eq 0"}
                                 <input type="file" class="form-control" name="file_input"  id="file_input"  accept="image/*" />
                                 {/if}
                                 <div id="rrr">
                                    {if condition="$img_src neq ''"}
                                     <img height="400" width="300" src="{$img_src}" >
                                     {/if}
                                 </div> 
                                 
                            </div>
                        </div>

                    
                        
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                {if condition="$sell['status'] eq 1"}
                                <button class="btn btn-primary" type="submit">{:lang('Confirmation of receivables')}</button>
                                {/if}
                                {if condition="$sell['status'] eq 1"}
                                <a href="">{:lang('Appeal')}</a>
                                {/if}
                            
                            </div>
                            
                        </div>
                    </form>
                    
                </div>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">

    function operateFormatter(value, row, index) {
        return [
            '<a class="btn btn-xs edit" href="javascript:void(0)" title="{$Think.lang.Edit}">',
            '<i class="fa fa-edit"></i>',
            '</a>  ',
            '<a class="btn btn-xs delete" href="javascript:void(0)" title="{$Think.lang.Delete}">',
            '<i class="fa fa-trash"></i>',
            '</a>'
        ].join('');
    }

    var operateEvents = {
        'click .edit': function (e, value, row, index) {
            var param = {
                url: "{:url('admin/user/edit');}",
                data: {id: row.id}
            }
            $("#table").gridView('loadModal', param.url,param.data)
        },
        'click .delete': function (e, value, row, index) {
            $("#table").gridView('deleteModal', 'delete', row)
            
        }
    };
</script>
<script type="text/javascript">
    function copyText() {
      var eth = document.getElementById("eth");
      eth.select(); 
      document.execCommand("Copy"); 
      alert("{:lang('Duplicate success')}");
    }
</script>  



<script type="text/javascript">
        var aaa = document.getElementById("rrr"); 
        var input = document.getElementById("file_input"); 
              
              
        if(typeof FileReader==='undefined'){ 
            aaa.innerHTML = "No FileReader"; 
            input.setAttribute('disabled','disabled'); 
        }else{ 
            input.addEventListener('change',readFile,false); 
        } 

              
        function readFile(){ 
            var file = this.files[0]; 
            
            if(!/image\/\w+/.test(file.type)){ 
               
                return false; 
            } 
            
            var reader = new FileReader(); 
            reader.readAsDataURL(file);
            reader.onload = function(e){ 
                aaa.innerHTML = '<img height="400" width="300" src="'+this.result+'" alt=""/>' 
            } 
        }
    </script>

